<template>
  <div class="kim-toast">
    <transition name="fade">
      <div>{{ content }}</div>
    </transition>
  </div>
</template>

<script>
export default {
  name: "toast",
  data() {
    return{
      content:'', //内容
      shown:false, //是否显示
    }
  },
  methods:{
    open(content) {
      this.content = content;
      this.shown = true;
    }
  }
}
</script>

<style scoped>
.fade-enter-active, .fade-leave-active {
  transition: opacity .5s;
}
.fade-enter, .fade-leave-to /* .fade-leave-active below version 2.1.8 */ {
  opacity: 0;
}
</style>